home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / misc / pbill31.lha / Phonebill / Install Phonebill < prev    next >
Text File  |  1994-08-27  |  8KB  |  261 lines

  1. (procedure DoComplete
  2.   (set anz (+ anz 17))
  3.   (complete anz)
  4. )
  5.  
  6. (complete 0)
  7.  
  8. (if (< (/ (getversion) 65536) 37)
  9. (
  10.         (abort wrongkickstart)
  11. ))
  12.  
  13.  
  14. (set pbilldest
  15.         (askdir
  16.                 (prompt "Where do you want to have the `phonebill' drawer installed?")
  17.                 (help @askdir-help)
  18.                 (default @default-dest)
  19.         )
  20. )
  21. (set pbilldir (tackon pbilldest "Phonebill"))
  22. (set @default-dest pbilldir)
  23. (set docdir (tackon pbilldir "Documentation"))
  24. (set configdir (tackon pbilldir "Config"))
  25. (set catalogdir (tackon pbilldir "Catalogs"))
  26. (set bakdir (tackon pbilldir "Backup"))
  27.  
  28. (set extype (exists pbilldir))
  29. (if (= extype 1) (abort "There already exists a file called \"Phonebill\""))
  30. (if (= extype 2)
  31.     (
  32.         (set oldvernum (getversion (tackon pbilldir "Phonebill")))
  33.         (set oldver (/ oldvernum 65536))
  34.         (set oldrev (- oldvernum (* oldver 65536) ) )
  35.         (if (= 1 (askbool (prompt "There already exists a `phonebill' drawer. "
  36.                                   "During installation certain files will be overwritten. "
  37.                                   "Do you want to create a backup (\"" bakdir "\") of the files "
  38.                                   "located in the `phonebill' drawer first?")
  39.                           (help @askbool-help)
  40.                  )
  41.             )
  42.             (
  43.                 (working "Creating backup...")
  44.                 (makedir bakdir (infos))
  45.                 (makedir (tackon bakdir "Phonebill"))
  46.                 (run ("copy \"%s\" \"%s\" all" (tackon pbilldir "~(Backup)") (tackon bakdir "Phonebill")))
  47.             )
  48.         )
  49.         (run ("delete \"%s\" all" (tackon pbilldir "~(Config|Backup|#?.Log|#?.Key)")))
  50.     )
  51.     (
  52.         (set oldver 0)
  53.         (set oldrev 0)
  54.         (set oldvernum 0)
  55.         (makedir pbilldir (infos))
  56.     )
  57. )
  58.  
  59. (makedir docdir (infos))
  60. (makedir catalogdir)
  61.  
  62. (DoComplete)
  63.  
  64. (copylib
  65.     (help @copylib-help)
  66.     (prompt "Installing gtlayout.library\nCopyright © 1990-1994 Olaf Barthel")
  67.     (confirm)
  68.     (source "Libs/gtlayout.library")
  69.     (dest "LIBS:")
  70. )
  71.  
  72. (DoComplete)
  73.  
  74. (copyfiles
  75.     (help @copyfiles-help)
  76.     (source "Phonebill")
  77.     (dest pbilldir)
  78.     (prompt "Installing the executable program")
  79.     (confirm)
  80.     (infos)
  81. )
  82.  
  83. (DoComplete)
  84.  
  85. (set docchoice
  86.     (askoptions
  87.         (prompt "There are three formats available for the documentation.")
  88.         (choices "AmigaGuide Format (required for online help)" 
  89.                  "TeX DVI Format (for printed manuals)"
  90.                  "Plain ASCII Format")
  91.         (help @askoptions-help)
  92.     )
  93. )
  94. (if (<> 0 (BITAND docchoice 1))
  95. (
  96.     (copyfiles
  97.             (prompt "Installing AmigaGuide manual...")
  98.             (source "Documentation/Phonebill.guide")
  99.             (dest docdir)
  100.             (infos)
  101.             (help @copyfiles-help)
  102.     )
  103. )
  104. )
  105.  
  106. (DoComplete)
  107.  
  108. (if (<> 0 (BITAND docchoice 2))
  109. (
  110.     (copyfiles
  111.             (prompt "Installing DVI manual...")
  112.             (source "Documentation/Phonebill.DVI")
  113.             (dest docdir)
  114.             (infos)
  115.             (help @copyfiles-help)
  116.     )
  117. )
  118. )
  119.  
  120. (if (<> 0 (BITAND docchoice 4))
  121. (
  122.     (copyfiles
  123.             (prompt "Installing ASCII manual...")
  124.             (source "Documentation/Phonebill.doc")
  125.             (dest docdir)
  126.             (infos)
  127.             (help @copyfiles-help)
  128.     )
  129. )
  130. )
  131.  
  132. (copyfiles
  133.         (prompt "Installing registration forms...")
  134.         (source "Documentation")
  135.         (dest docdir)
  136.         (pattern "#?form")
  137.         (infos)
  138.         (help @copyfiles-help)
  139. )
  140.  
  141. (set installedcfg 0)
  142. (DoComplete)
  143. (if (exists "envarc:phonebill/phonebill.prefs")
  144.     (
  145.         (if (= 1    (askbool(prompt (cat "Old (pre 3.0) `phonebill' configuration files have been found in \"ENV:\" and \"ENVARC:\". "
  146.                                          "Starting from release 3.0, the configuration files "
  147.                                          "have changed from IFF format to plain ASCII text files. "
  148.                                          "Do you want to update these configuration files for use "
  149.                                          "with this release, or do you want to use "
  150.                                          "the default configuration files ?"
  151.                                     )
  152.                              )
  153.                             (help @askbool-help)
  154.                             (choices "Update configuration" "Default configuration")
  155.                     )
  156.             )
  157.  
  158.             (
  159.                 (working "Updating configuration")
  160.                 (makedir configdir (infos))
  161.                 (run "UpdateConfig2.x")
  162.                 (run "copy config/Scanner.config t:")
  163.                 (copyfiles
  164.                     (help @copyfiles-help)
  165.                     (prompt "Installing the updated configuration files")
  166.                     (source "T:")
  167.                     (dest configdir)
  168.                     (pattern "#?.config")
  169.                     (confirm)
  170.                 )
  171.                 (set installedcfg 1)
  172.             )
  173.         )
  174.         (if (= 1 (askbool (prompt (cat "The files in \"ENV:\" and \"ENVARC:\" are no longer "
  175.                                        ("needed. Do you want to move them to \"%s\" ?" (tackon bakdir "ENV"))
  176.                                   )
  177.                           )
  178.                           (help @askbool-help)
  179.                  )
  180.             )
  181.             (
  182.                 (working "Removing `phonebill' related files from \"ENV:\" and \"ENVARC:\"")
  183.                 (if (= 0 (exists bakdir)) (makedir bakdir))
  184.                 (makedir (tackon bakdir "ENV"))
  185.                 (makedir (tackon bakdir "ENV/Phonebill"))
  186.                 (copyfiles
  187.                     (source "ENVARC:Phonebill")
  188.                     (dest (tackon bakdir "ENV/Phonebill"))
  189.                     (pattern "#?.prefs")
  190.                 )
  191.                 (run "delete env:phonebill all")
  192.                 (run "delete envarc:phonebill all")
  193.             )
  194.         )
  195.     )
  196. )
  197.  
  198.  
  199. (if (= installedcfg 0)
  200.     (
  201.         (if (= 0 (exists configdir))
  202.             (
  203.                 (makedir configdir (infos))
  204.                 (copyfiles
  205.                     (help @copyfiles-help)
  206.                     (prompt "Installing the default configuration files")
  207.                     (source "Config")
  208.                     (dest configdir)
  209.                     (all)
  210.                     (confirm)
  211.                 )
  212.                 (message "There are a lot of rates for several countries defined in the "
  213.                          "\"rates.config\" file. Each time `phonebill' is run it has to "
  214.                          "read this file, which takes its time. To speed-up this process, "
  215.                          "remove the rates that you don't need.")
  216.             )
  217.             (
  218.                 (if (and (= oldver 3) (= oldrev 0))
  219.                     (
  220.                         (message "The configuration needs to be updated for use with this release of `phonebill'.")
  221.                         (working "Updating configuration")
  222.                         (run ("UpdateConfig3.0 \"%s\"" configdir))
  223.                         (copyfiles
  224.                             (help @copyfiles-help)
  225.                             (prompt "Installing the updated configuration files")
  226.                             (source "T:")
  227.                             (dest configdir)
  228.                             (pattern "#?.config")
  229.                             (confirm)
  230.                         )
  231.                     )
  232.                 )
  233.                 (copyfiles
  234.                     (help @copyfiles-help)
  235.                     (source "Config/Scanner.config")
  236.                     (dest configdir)
  237.                     (prompt "Installing the newest `Scanner.config'")
  238.                     (confirm)
  239.                     (infos)
  240.                 )
  241.             )
  242.         )
  243.         
  244.     )
  245. )
  246.  
  247. (
  248.     (copyfiles
  249.         (help @copyfiles-help)
  250.         (prompt "Installing catalog files")
  251.         (source "Catalogs")
  252.         (dest catalogdir)
  253.         (all)
  254.         (confirm)
  255.     )
  256. )
  257.  
  258. (complete 100)
  259. (exit)
  260.  
  261.